﻿<html>

<?php 
	include_once("config.php");
	$lev= setlev(0);
	include_once($lev."templates/headtpl.php");
	include_once($lev."util/mysqlconn.php");
	
?>
<div id="container">
	<div id="links" class="listbox">
		<dl>
		
			<dt>
				<span class="title"><a href="/farmer/news/index.php" title="">最新消息</a></span>
				<span class="more"><a href="/farmer/news/index.php" target="_blank">更多...</a></span>
			</dt>
			
			<dd>
		<div id="newslinks">
			<marquee direction="up" behavior="scroll" scrollamount="1" scrolldelay="10" onMouseOver="this.stop()" onMouseOut= "this.start()">
				<table class="topnews">
					<thead>
						<tr></tr>
					</thead>
					<tbody>
				<?php
					if (!$conn){
						echo "<h1>数据库连接异常</h1>";
					}
					$sqlstr ="SELECT * FROM newsprice ORDER BY presstime DESC LIMIT 5 ";
					$res = $conn->query("SELECT * FROM paper where tag='news' ORDER BY presstime DESC LIMIT 10 ");
					if (!$res){
						echo "<h1>查询结果异常</h1>";
					}
					if ($res->num_rows!=0){
						while ($row = $res->fetch_array(MYSQLI_BOTH)){
							echo "<tr>";
								printf("<td><a href='/farmer/news/topic.php?paperid=%s'><span>%s</span></a></td>",$row['paperid'],$row['title']);
							echo "</tr>";
						}
					}
				?>
					</tbody>
				</table>
			</marquee> 
		</div>
			</dd>
		</dl>
	</div>
	
	<div id="content">
		<div class="thisplace">
			<div class="title"> 图片文章 </div>
		</div>
			
		<div class="picnews margintop">
			<dl>
				<dd><a target="_blank" class="pimg" href=""><img height="98" width="152" border="0" alt="农业生产" src="/farmer/pic/far3.jpg"/></a>
					<span><a target="_blank" title="农业生产"  href="">农业生产</a>
				</span></dd>
				<dd><a target="_blank" class="pimg" href=""><img height="98" width="152" border="0" alt="农业生产" src="/farmer/pic/far4.jpg"/></a>
					<span><a target="_blank" title="北京顺义三高农业示范区"  href="">北京顺义三高农业示范区</a>
				</span></dd>
				
			</dl>
			<dl>
				<dd><a target="_blank" class="pimg" href=""><img height="98" width="152" border="0" alt="农业生产" src="/farmer/pic/far1.jpg"/></a>
					<span><a target="_blank" title="高科技南瓜"  href="">高科技南瓜</a>
				</span></dd>
				<dd><a target="_blank" class="pimg" href=""><img height="98" width="152" border="0" alt="农业生产" src="/farmer/pic/far2.jpg"/></a>
					<span><a target="_blank" title="在田间"  href="">在田间</a>
				</span></dd>
				
			</dl>
			
		</div>	
			
	</div>
</div>
<?php 
	include_once($lev."templates/foottpl.php");
?>
</html>
